home *** CD-ROM | disk | FTP | other *** search
/ PC-Blue - MS DOS Public Domain Library / PC-Blue MS-DOS Public Domain Library - NYACC.iso / vol330 / gagsdocs.arc / PART2.DOC < prev    next >
Encoding:
Text File  |  1986-06-15  |  41.5 KB  |  953 lines

  1.                                       2-1
  2.  
  3.       The Generic Adventure Game System
  4.     Copyright 1985,1986 by Mark J. Welch  415-845-2430 (voice)
  5.  
  6.                       __________________________________
  7.                      |                                  |
  8.                      |  How to write an adventure game: |
  9.                      |__________________________________|
  10.       
  11.                                    
  12.       
  13.       -------------------------------------------------------
  14.       Introduction: Why Should I Write My Own Adventure Game?
  15.       -------------------------------------------------------
  16.       
  17.          If you're asking that question, it's quite possible that you 
  18.       shouldn't. But let me suggest a scenario: 
  19.       
  20.         - Imagine your office as an adventure game. Imagine the 
  21.       wonderful descriptions you could provide for your co-workers' 
  22.       offices, the analogies you could make for the delivery people, 
  23.       and the thinly-veiled insults of your boss you could include. If 
  24.       such an adventure game scenario were written in reasonable taste, 
  25.       it could serve as a well-deserved diversion on a Friday 
  26.       afternoon. Of course, if it's written in poor taste, and your 
  27.       insults aren't veiled enough, it could be your last Friday.  
  28.         -  Maybe you are trying to teach someone something. Perhaps you 
  29.       want them to learn about computers. Maybe you want to guide them 
  30.       through many screens of tutorials. If you could write the text as 
  31.       an adventure game, and make learning a game -- even fun -- the 
  32.       game players might learn more faster.  
  33.         - Or maybe you're well-equipped with a great imagination and 
  34.       you want to develop a game that will rival the ones you've 
  35.       bought in stores or played with friends. Perhaps this is your 
  36.       chance to prove your fiction-writing abilities. Who knows what 
  37.       adventure lurks in the heart of the computer user?  
  38.       
  39.       
  40.  
  41.                                       2-2
  42.  
  43.       ---------------------------------------------------------
  44.       How the Adventure Game Works -- A Superficial Explanation
  45.       ---------------------------------------------------------
  46.       
  47.       (This section explains how GAGS does what it does. You might want 
  48.       to look at a copy of a .DAT file, such as UNDERGND.DAT, as you 
  49.       read this.) 
  50.       
  51.       
  52.       A Sequential Account
  53.       --------------------
  54.       As an author, I knew that anyone who developed an adventure game 
  55.       using GAGS would want instant credit, so the first thing GAGS 
  56.       does is look on the disk for a title file, which should contain 
  57.       the name of the game, the author's name, and perhaps a copyright 
  58.       statement. Each line in the file is displayed centered on the 
  59.       screen. 
  60.            Being protective, I also make sure the program posts my 
  61.       copyright notice just below the game writer's. If, for some 
  62.       reason, there is no file TITLE.DAT, the GAGS copyright 
  63.       information is displayed by itself. The title screen, with the 
  64.       author's information and mine, stays on the screen while the 
  65.       program initializes all its data arrays and records and reads the 
  66.       data file.  
  67.            The program next reads the datafile (filename.DAT). It 
  68.       searches each of its 17 keywords (words like "ROOM," "NOUN," or 
  69.       "CREATURE"). When it finds one of these words as the first word 
  70.       on a line (ignoring spaces and punctuation), it looks for a 
  71.       number so it knows where to store the information that follows.  
  72.       It then carefully analyzes each line that follows, updating its 
  73.       internal arrays to match the specifications in the text file, 
  74.       until it finds a keyword beginning with "END_" (i.e.  
  75.       END_CREATURE, END_NOUN, END_ROOM).  Note: the game will NOT 
  76.       detect a mismatched END_keyword; all it really checks is that the 
  77.       the first four letters are "END_".  
  78.            Since the file contains both descriptions and data record 
  79.       information, it takes a while to scan the whole file: for a 30K 
  80.       file with about 65 rooms, it takes fifty seconds. Among other 
  81.       things, this gives the player a good chance to read the title 
  82.       screen, thus satisfying the game author's conceit and mine.  
  83.            If the file contains some text preceded by the keyword INTRO 
  84.       and ended with the keyword END_INTRO, that text is displayed as 
  85.       it is encountered. It cannot be re-read during the game.   
  86.            Once all the data has been read in, the program puts the 
  87.       player into room 2 of the game (there is no room 1: a location of 
  88.       1 indicates the player's pockets). GAGS then prints the long text 
  89.       description for room 2, (defined by ROOM_DESCR 2...END_ROOM_DESCR)
  90.       and the player is asked what to do.  
  91.             
  92.                                  (continued)
  93.       
  94.                                       2-3
  95.    
  96.                           (how GAGS works, continued)
  97.        
  98.       
  99.            Each time the player types in a command and <ENTER>, the 
  100.       program sends the input line to the "parse" module. The parser 
  101.       take the input line, breaks it into separate words, and tries to 
  102.       locate a verb, a noun, a preposition, and another noun as the 
  103.       object of the preposition. It does this by eliminating extra 
  104.       words like "the" and "please"; and by checking and then 
  105.       eliminating adjectives. It returns four words: verb, noun, 
  106.       preposition, and an object of the preposition. (If any element is 
  107.       missing, the "empty string" ('') is returned.) 
  108.            If an invalid word is found by the parser, it informs the 
  109.       user by suggesting what part of speech it sought and what word it 
  110.       didn't recognize. Otherwise, the program then calls the execute 
  111.       module; this section selects a procedure to call based on the 
  112.       verb (throw, take, eat, move). Depending on the procedure's own 
  113.       checking, the noun, preposition and object might be rejected as 
  114.       invalid or, in some cases, ignored partly or completely.  
  115.       
  116.            If motion is called for, the program checks to see if the 
  117.       direction is valid (i.e. if moving EAST was supposed to get the 
  118.       player to a new room). If it's valid, the player is moved to the 
  119.       new room; if not, the player is informed. Other actions are 
  120.       checked in the same way: if a noun is expected, does the player 
  121.       have it or is it in the room? If the thing is here, does this 
  122.       time, place, and action constitute a special event of some sort? 
  123.       If it does, the player is sent off to a "special" procedure; 
  124.       otherwise the action is executed and the thing is changed as 
  125.       specified, or is described or taken. 
  126.       
  127.            There are two ways a player can be moved to a new room. One 
  128.       is by specifically trying to do so. Moving east is generally 
  129.       accomplished by typing "EAST." 
  130.            The other way to move is by meeting a set of special 
  131.       requirements that the current game's author has defined as a 
  132.       "special." The special might be defined, in plain language, as "if 
  133.       the player is in the sauna, and he turns the faucet, then move him 
  134.       to another room X." That other room might be anything.  One 
  135.       possibility is that it may be a room with a similar or identical 
  136.       description, but with a new exit or without an old one.  It might 
  137.       even be the same room, but by executing the "special," the program 
  138.       displays several lines of text.  
  139.           In this case, the special text might be "You turn on the 
  140.       faucet, and scalding hot water pours onto your feet. You scream in 
  141.       agony and kick the faucet, which is turned off." If the author was 
  142.       cruel, the "special" here might move the player to a new room 
  143.       called "hell" and be told "As you turn the faucet, scalding hot 
  144.       water pours out onto your legs. You scream in agony, but the faucet 
  145.       won't shut off. In minutes, you are scalded to death. You awaken in 
  146.       hell, where Satan tells you that your punishment for killing the 
  147.       lizard [something the player did earlier to get here] will be 
  148.       boiling in oil for eternity."  The new room description would 
  149.       describe a vat of boiling oil, provide no exits, and include the 
  150.       keyword GAME_END to end the game.  
  151.       
  152.                                  (continued)
  153.       
  154.                                       2-4
  155.  
  156.                          (how GAGS works, continued)
  157.        
  158.       
  159.            "Specials" are the way you do almost anything unusual.  Of 
  160.       course, a special can be used to move a player to a new room 
  161.       (i.e.  "touch mirror" might cause the player to fall through the 
  162.       looking-glass and into a new room). But specials also allow a 
  163.       room to be "changed" in the player's view -- this is accomplished 
  164.       by actually moving the player to a new, but similar room. If you 
  165.       want an airlock to close one door and open another, you use a 
  166.       "special" which moves the player to a 'new' airlock with a 
  167.       different exit. If you want a player to 'teleport,' you use a 
  168.       special. If you want to player to be surprised by some action but 
  169.       not moved (i.e. 'play stereo' could lead to "Beethoven's Fifth 
  170.       plays loudly, awakening the neighbors.  Someone pounds loudly on 
  171.       the ceiling"), use a special.  
  172.            There is one problem with using a special to "change" a 
  173.       room. If you decide, for example, to have a player move from an 
  174.       intact room to a damaged room when s/he decides to "push button," 
  175.       you may have some problems. Suppose the intact room was 13, the 
  176.       damaged room was 14, and room 7 was adjacent. The player moves 
  177.       east from 7 to 13.  S/he pushes the button and is "specialed" to 
  178.       room 14. S/he exits west to room 7, since you've provided that 
  179.       exit from either room 13 or 14. When s/he moves east from 7, 
  180.       however, s/he moves back to room 13, since room 7's pointers 
  181.       remain unchanged by the "special." My fix to this is to simply 
  182.       not provide reverse pointers: once you've blown up a room, make 
  183.       sure the player can't ever trace his/her steps back to the 
  184.       undamaged room.  
  185.       
  186.            Internally, specials are stored as a direction, and each 
  187.       room that has a special has a "key" -- a matching noun. This is 
  188.       probably the most complex part of creating an adventure game: you 
  189.       need to have some fairly complex linkage in your data file, all 
  190.       done manually. 
  191.       
  192.       
  193.                                       2-5
  194.       
  195.       How GAGS Works: Another Approach
  196.       -------------------------------- 
  197.       
  198.       GAGS keeps track of three large record arrays internally: the 
  199.       rooms, the nouns, and the creatures. 
  200.       
  201.       -----
  202.       Rooms
  203.       -----
  204.       
  205.       Each room is a record, with the following fields:
  206.          name (string) 
  207.          n,s,e,w,ne,se,sw,nw,u,d,enter,exit,special 
  208.                      (all integers: what room do they lead to?)
  209.          key (integer - what noun activates the 'special' direction?)
  210.          has_seen (true/false: has the player seen this room yet?)
  211.          locked_door  (true/false - is there a locked door here?)
  212.          points (how many points for just getting to this room?)
  213.       
  214.       The room specification in the data file is quite simple:
  215.       
  216.         ROOM <nn>
  217.         <Room Name>
  218.         <direction> <nn>
  219.               .
  220.               .
  221.               .
  222.         <direction> <nn>
  223.         <  optional: SPECIAL <nn>    and  KEY <nn>  >
  224.         <  optional: POINTS <n>                     >
  225.         <  optional: LIGHT <nn>                     >
  226.         <  optional: GAME_END                       >
  227.         END_ROOM
  228.       
  229.       A room description must also be provided: 
  230.       
  231.       ROOM_DESCR <nn>
  232.       Some text, any number of lines, about the room.
  233.       END_ROOM_DESCR
  234.       
  235.       (Similar formats are used for descriptions of nouns and creatures.)
  236.       
  237.       It is recommended that at a minimum, one exit be provided; 
  238.       otherwise the player will be stuck in the room until he quits. Of 
  239.       course, that direction might be a special. 
  240.      
  241.       
  242.                                       2-6      
  243.  
  244.       --------
  245.       Specials
  246.       --------
  247.            To 'activate' the special, the player must 'do something' to 
  248.       the noun specified as the room's KEY. This can include turning 
  249.       it, pushing it, pulling it, or playing it (depending on what can 
  250.       be done to the noun as defined). If the proper action is taken on 
  251.       the noun while in the room, the player will be relocated to the 
  252.       room specified in the SPECIAL line and the SPECIAL nn text will 
  253.       be displayed. (If the Special points to the current room, the 
  254.       only effect apparent to the reader will be the display of the 
  255.       SPECIAL text.) 
  256.       
  257.       An example:
  258.       
  259.       --------
  260.       
  261.       ROOM 13
  262.         .
  263.         .
  264.       SPECIAL 13
  265.       KEY 218
  266.       END_ROOM
  267.       
  268.       NOUN 218
  269.       Stereo
  270.         .
  271.         .
  272.       TURNABLE
  273.       PLAYABLE
  274.       END_NOUN
  275.       
  276.       SPECIAL 13
  277.       As you turn on the stereo, you hear a song by "Duran Duran." The 
  278.       stereo turns itself off when the song is finished.
  279.       END_SPECIAL
  280.       
  281.       -----------
  282.       
  283.       Defaults:  The default for almost all integer values is zero: 
  284.       thus, any direction not specified will be set to zero (no room), 
  285.       including 'special' and the key noun pointer, unless the data 
  286.       file specifies differently.  
  287.       
  288.       
  289.                                       2-7
  290.  
  291.       -----
  292.       Nouns
  293.       -----
  294.       
  295.       Nouns are necessarily more complex. They are specified in the 
  296.       following format, listed with the possible values (and defaults) 
  297.       
  298.       NOUN <nn>       
  299.       <name>   - must appear on second line, must be one word (underscores 
  300.                             permitted) 
  301.       <adjective> - must appear on 3rd line - a one-word adjective (or 'NO_ADJ')
  302.       <short>  - must appear on 4th line - one line of text describing the noun 
  303.            (the remaining words and phrases may appear in any order or may be 
  304.            omitted to obtain the default values) 
  305.       WEIGHT <nn>     - 1 to 100+ (default=1)
  306.       SIZE <nn>       - 1 to 100+ (default=1)
  307.       LOCATION <nn>   - initial location (room number, another noun, or the 
  308.                             player) (1=player) (default = 0) 
  309.       READABLE        - default is 'not readable'
  310.       CLOSABLE        - default is 'not closable'
  311.       CLOSED          - default is 'open'
  312.       ON              - default is 'off'
  313.       PUSHABLE        - default is 'not pushable' - activates special!
  314.       TURNABLE        - default is 'not turnble' - activates special!
  315.       PLAYABLE        - default is 'not playable' - activates special!
  316.       LOCKABLE        - default is 'not lockable'
  317.       LOCKED          - default is 'unlocked'
  318.       KEY <nn>        - default is 0 (what noun is used to unlock this noun?)
  319.       POISONOUS       - default is 'nonpoisonous'
  320.       EDIBLE          - default is 'inedible'
  321.       DRINKABLE       - default is 'undrinkable'
  322.       UNMOVABLE       - default is 'movable' (can be TAKEn)
  323.       POINTS <nn>     - default is 0 -- how many points if carried?
  324.       IS_LIGHT        - default is 'false'
  325.       END_NOUN        - this word must appear alone on a line!
  326.       
  327.       Note: To 'spice' up the game, you might want to put things inside 
  328.       other things initially, so the player has to open everything to 
  329.       be sure s/he doesn't miss anything important. Be logical, though: 
  330.       a refrigerator seems likely to be open-able, but a crabapple 
  331.       probably ought to be 'closed' and 'unclosable' and thus unable to 
  332.       contain something else (unless you're into razor blades...). 
  333.       
  334.       
  335.                                       2-8      
  336.  
  337.       ----
  338.       TEXT
  339.       ----
  340.         Things that can be "read" are perhaps best described as 
  341.       "special specials." Rather than using the "SPECIAL" function, 
  342.       readable objects use "TEXT." Thus, the following would be a 
  343.       valid set of definitions:
  344.       
  345.       --------
  346.       
  347.       NOUN 232
  348.       Book
  349.       Red
  350.       There is a small red book here.
  351.       WEIGHT 1
  352.       SIZE 3
  353.       LOCATION 32
  354.       READABLE
  355.       END_NOUN
  356.       
  357.       NOUN_DESCR 232
  358.       The red book is quite thin, and has a hard cover. There is 
  359.       writing on the book.
  360.       END_NOUN_DESCR
  361.       
  362.       TEXT 232
  363.       The title of the book is "The Wisdom of Ronald Reagan."
  364.       The pages are all blank.
  365.       END_TEXT
  366.       
  367.       
  368.       
  369.       ----------
  370.       PUSH_DESCR
  371.       PULL_DESCR
  372.       TURN_DESCR
  373.       PLAY_DESCR
  374.       ----------
  375.       If a noun is described as being pushable, playable, turnable, or 
  376.       pullable, you can define a response to the player taking those 
  377.       actions. This description will be displayed only if the player 
  378.       takes the specified action AND that action does not activate a 
  379.       SPECIAL for the current room. If there is no description 
  380.       provided, a standard ("nothing happens") message is provided.
  381.       
  382.       
  383.                                       2-9
  384.       
  385.       ---------
  386.       Creatures
  387.       ---------
  388.       
  389.       Creatures, like rooms, are relatively simple. Any living thing is 
  390.       identified as a 'creature', and can be either 'friendly' or 
  391.       'hostile'. 
  392.       
  393.       CREATURE <nn>
  394.       <name>
  395.       <adjective>
  396.       <short descriptive line of text>
  397.       LOCATION <nn>           - default := 0
  398.       WEAPON <nn>             - what noun kills it? (default := 0)
  399.       HOSTILE                 - (default is FRIENDLY)
  400.       END_CREATURE             - must be the only thing on the line!
  401.       
  402.       Friendly creatures are quite passive; hostile creatures are not 
  403.       quite as friendly. It is recommended that provisions be made for 
  404.       a weapon to kill any hostile creatures. For fairness, that weapon 
  405.       should be accessible by the player BEFORE s/he meets the hostile 
  406.       creature. 
  407.          Players should be discouraged from wild and unwarranted 
  408.       killing: i.e. they ought not kill friendly creatures. If no 
  409.       weapon will kill the creature (i.e. if you leave or specify 
  410.       WEAPON as the default value 0), the player cannot kill it. For 
  411.       friendly creatures, you should not lead the player on by making 
  412.       the weapon something unexpected: if the player kindly offers a 
  413.       jelly bean to the friendly creature, it ought not be fatal. On the 
  414.       other had, using a poisoned jelly bean to kill the Reagan_Beast 
  415.       might be both appropriate and challenging. Only one weapon can 
  416.       kill any given creature, but the same weapon might be used to kill 
  417.       many creatures. 
  418.       
  419.       ---------
  420.       
  421.       
  422.       
  423.                                       2-10      
  424.  
  425.       Some last-minute notes:
  426.       
  427.       
  428.       Order of definitions:
  429.          Note: GAGS doesn't require that the definitions be in a 
  430.       specific order. Definitions can be freely mixed throughout your 
  431.       data files. You'll probably want to group items together that 
  432.       logically belong together; that's how I wrote the sample game. 
  433.       The order of definitions in the file has NO effect on game 
  434.       performance, as long as each definition is properly structured.  
  435.       If you write 'INTRO' text for the game, it's best to put that 
  436.       text at the end of the data file; that way the initialization 
  437.       will be done when the player finishes reading the introduction.  
  438.       (If the INTRO text is at the top of the file, GAGS must read the 
  439.       rest of the data file after the player has read the 
  440.       introduction, causing a more noticable and worrisome delay.) 
  441.       
  442.       
  443.       Word Processors:
  444.          Note: I used PC-Write to create the sample adventure file. You 
  445.       MUST use a word processor which creates plain ASCII/DOS text 
  446.       files with a true carriage return at the end of each line. Lines 
  447.       longer than 80 characters, and WordStar document files, will 
  448.       cause GAGS to gag! (For information on obtaining PC-Write, see 
  449.       appendix D -- "Other Shareware.") 
  450.       
  451.       Value Ranges for Game Definitions:
  452.          Note: The following are the valid ranges of numbers for nouns,
  453.       rooms, and creatures. DO NOT assign improper numbers to any 
  454.       category, or you will experience unpredictable (but consistently 
  455.       erroneous) results.
  456.               Player:           1
  457.               ROOMS:            2     to      199
  458.               NOUNS:          201     to      299
  459.               CREATURES:      301     to      399
  460.       
  461.       Note: The GameWriter Diagnostics Mode
  462.       
  463.            GAGS has a "diagnostics" mode which should be somewhat 
  464.       helpful as you develop games. By adding /d to the DOS command 
  465.       line that invokes GAGS, you'll be able to see exactly what the 
  466.       game is doing during initialization. If you compare a paper copy 
  467.       of your .DAT file to the diagnostics screen output, you'll be 
  468.       able to see exactly when and if the system encounters any 
  469.       problems with your file. The diagnostics mode is specifically 
  470.       designed to let you graphically see if any "END_" statements are 
  471.       missing. It is not a very powerful debugging tool, but it takes 
  472.       much of the guesswork out of the system.  
  473.        
  474.                                  (continued)
  475.       
  476.                                       2-11
  477.  
  478.                         (Last-minute notes, continued)
  479.       
  480.       
  481.       Light and Darkness:
  482.          If a room has a LIGHT value other than 0 (the default), the 
  483.       room will appear pitch black if the player wanders in empty-
  484.       handed. There are two "types" of lights and two types of 
  485.       darkness. A noun may be defined as being a light by specifying 
  486.       the word IS_LIGHT in its definition; in this case, it will light 
  487.       any dark room defined as LIGHT 1. The light value of 1 in a room
  488.       definition means that any light will make the room visible. Of 
  489.       course, these "general-purpose" lights must be turned on to light 
  490.       the room, and thus all LIGHTs can be TURNed ON and OFF (or 
  491.       LIGHTed and EXTINGUISHed.). (EXT is an acceptable abbreviation 
  492.       for EXTINGUISH; EX is the abbreviation for EXAMINE.) 
  493.          If the LIGHT value is more than 1 (i.e. LIGHT 218), only the
  494.       noun with the matching number will make the room's contents 
  495.       visible. This is useful if the darkness comes from something 
  496.       other than an absence of light: for example, a fan might be the 
  497.       only object that makes a smoky room clear enough to see in. 
  498.       A special-purpose light need not be defined as a light (i.e. it 
  499.       doesn't have to be defined IS_LIGHT), nor does it have to be on, 
  500.       to work as a light in a room with that noun as a LIGHT. A 
  501.       noun can function as a special-purpose light for more than one 
  502.       room, but each room can only be lit by one special-purpose light. 
  503.       (A room with a LIGHT value of 1 will be lit by ANY noun defined 
  504.       as IS_LIGHT.)
  505.       
  506.       
  507.       -----------
  508.       
  509.       Note: Command abbreviations
  510.       
  511.            Some command abbreviations have been implemented:
  512.       
  513.               .       =       examine (i.e. ". bar")
  514.               !       =       attack  (i.e. "! wolf")
  515.               ex      =       examine
  516.               ext     =       extinguish (turn off)
  517.       
  518.       
  519.       
  520.                                       2-12      
  521.  
  522.       Creating a typical room:
  523.       ------------------------
  524.       
  525.          Let's suppose that my game contains a bedroom, connected to a 
  526.       closet, a bathroom, and a hallway. In the bedroom are a lamp, a 
  527.       bed, a dresser, a mirror, and a werewolf.
  528.       
  529.          First, I want to define the room itself:
  530.       
  531.       
  532.       ===============================================
  533.       ROOM 34
  534.       Master Bedroom
  535.       WEST 33                 (33 is the hallway)
  536.       EAST 35                 (35 is the bathroom)
  537.       NORTHEAST 36            (36 is the closet)
  538.       END_ROOM
  539.       ===============================================
  540.       
  541.          A description of the room is appropriate here:
  542.       
  543.       ===============================================
  544.       ROOM_DESCR 34
  545.       This is the master bedroom, where Mommy and Daddy usually sleep.
  546.       Plainly visible in the room are a bed, a dresser, a lamp, and a 
  547.       large wall mirror. The room smells horrible, as if a large, 
  548.       unclean animal had been here recently.
  549.       END_ROOM_DESCR 
  550.       =============================================== 
  551.       
  552.          Note that this description mentions the nouns that are 
  553.       initially in the room. This is OK, since all of the nouns are 
  554.       UNMOVABLE, but if they could be taken by the player, they should 
  555.       not be described in the room description since they won't be 
  556.       there if the player should return.
  557.       
  558.          That werewolf is begging to be described, too:
  559.       
  560.       
  561.       ===============================================
  562.       CREATURE 315
  563.       Werewolf
  564.       Black
  565.       There is a menacing black werewolf here.
  566.       LOCATION 34
  567.       WEAPON 217                      <-- Noun 217 will kill it 
  568.       HOSTILE                         <-- ever met a friendly werewolf?
  569.       END_CREATURE
  570.       ===============================================
  571.       
  572.       ===============================================
  573.       CREATURE_DESCR 315
  574.       The werewolf is about the size of a small horse. Its matted fur 
  575.       stinks, and a sickening smell emerges from its open mouth, 
  576.       through which you can see sharp, large teeth.  
  577.       END_CREATURE_DESCR
  578.       ===============================================
  579.       
  580.                                       2-13
  581.       
  582.          Finally, each noun within the room ought to be defined and 
  583.       described:
  584.       
  585.       ===============================================
  586.       NOUN 220
  587.       Bed
  588.       Large
  589.       There is a large (king-size) bed here.
  590.       LOCATION 34
  591.       UNMOVABLE
  592.       END_NOUN
  593.       ===============================================
  594.       NOUN_DESCR 220
  595.       The bed is quite ordinary.
  596.       END_NOUN_DESCR
  597.       ===============================================
  598.       NOUN 221
  599.       Dresser
  600.       Wooden
  601.       There is a large wooden dresser here.
  602.       LOCATION 34
  603.       CLOSABLE
  604.       CLOSED
  605.       UNMOVABLE
  606.       END_NOUN
  607.       ===============================================
  608.       NOUN_DESCR 221
  609.       The wooden dresser looks pretty much like most wooden dressers.
  610.       END_NOUN_DESCR
  611.       ===============================================
  612.       NOUN 222
  613.       Lamp
  614.       Small
  615.       There is a lamp on the dresser.
  616.       LOCATION 34
  617.       UNMOVABLE
  618.       END_NOUN
  619.       ===============================================
  620.       NOUN_DESCR 222
  621.       The small table lamp is pink and has a green shade. 
  622.       END_NOUN_DESCR
  623.       ===============================================
  624.       NOUN 223
  625.       Mirror
  626.       Strange
  627.       There is a wall-size mirror here.
  628.       LOCATION 34
  629.       UNMOVABLE
  630.       END_NOUN
  631.       ===============================================
  632.       NOUN_DESCR 223
  633.       As you gaze into the mirror, you sense something unusual about 
  634.       it. It seems to shimmer, and your reflection seems somehow 
  635.       unreal, as if the mirror weren't really there at all.
  636.       END_NOUN_DESCR
  637.       ===============================================
  638.       
  639.                                       2-14
  640.       
  641.          Hmm. That mirror seems rather interesting. Maybe we could make 
  642.       a "special" out of it. For example: when the player touches it, 
  643.       s/he is sent to room 50, the mystic cavern of the Wizardess.
  644.       To do so, we need to add a "special" to room 34 and specify the 
  645.       mirror as its key, and we need to make the mirror touchable.
  646.       (Note: "touch" and "push" are synonyms -- you should use the 
  647.       word "push," not the word "touch," in your definitions.) 
  648.                                                                     
  649.       ===============================================
  650.       ROOM 34
  651.       Master Bedroom
  652.       WEST 33                 (33 is the hallway)
  653.       EAST 35                 (35 is the bathroom)
  654.       NORTHEAST 36            (36 is the closet)
  655.       SPECIAL 50              <--
  656.       KEY 223                 <--
  657.       END_ROOM
  658.       ===============================================
  659.       
  660.       ===============================================
  661.       NOUN 223
  662.       Mirror
  663.       Strange
  664.       There is a wall-size mirror here.
  665.       LOCATION 34
  666.       UNMOVABLE
  667.       PUSHABLE               <-- Here's how we'll activate the special
  668.       END_NOUN
  669.       ===============================================
  670.       
  671.       
  672.          The player will see room 50's description when s/he gets 
  673.       there, but the SPECIAL text for room 50 will be displayed first:
  674.       
  675.       
  676.       ===============================================
  677.       SPECIAL 50
  678.       You reach out to touch the mirror, and are shocked to find that 
  679.       your fingers vanish through the surface. Before you can react, 
  680.       you feel yourself drawn forward through the mirror, and into a 
  681.       black nothingness. You look back to try to see the mirror, but 
  682.       everything is black.
  683.          You are falling, but not very quickly -- it's almost as if you 
  684.       are floating. As you fall, your eyes begin to adjust to the 
  685.       darkness. Then, suddenly, you land on a soft cushion of some 
  686.       sort. As you rest on the cushion, your eyes adjust to the very 
  687.       dim light of this new room.  
  688.       END_SPECIAL
  689.       ===============================================
  690.       
  691.         (Note that usually, you'd want to have a PUSH_DESCR  prepared 
  692.         for when the player touches a noun when it doesn't activate a 
  693.         special, but the mirror can't be moved so it will always 
  694.         activate a special when touched.)
  695.          
  696.       
  697.                                       2-15
  698.  
  699.       How to include Comments:
  700.       ------------------------
  701.       
  702.          Within your data file, you'll probably want to include 
  703.       comments which won't be processed by the game itself, so you'll 
  704.       be able to understand why you did certain things.
  705.          
  706.          In general, GAGS treats anything it doesn't understand as a 
  707.       comment. Thus, if you have a paragraph of text in between 
  708.       definitions, GAGS will usually ignore it.
  709.          BEWARE: If one of the lines in the paragraph begins with a 
  710.       keyword like "noun" or "text," GAGS will probably decide that 
  711.       it's the beginning of a definition and get confused.  
  712.          To avoid this, you can use a nonsense word to start each line 
  713.       of a comment: words like "REM" (for remark) are useful since they
  714.       also clearly state what the line is. 
  715.          Gags ignores most punctuation completely, so using "comment" 
  716.       indicators like "(*" and "*)" or { and } won't help anything. 
  717.       GAGS usually only sees alphabetic characters ('a'..'z' and 
  718.       'A'..'Z').
  719.          You can put comments on lines which contain a keyword or a 
  720.       keyword and a number; don't include comments on lines which 
  721.       contain a full-line description.
  722.       
  723.       Example of properly-commented definitions:
  724.       
  725.       ===============================================
  726.       ROOM 34                 
  727.       Master Bedroom
  728.       WEST 33                 (33 is the hallway)
  729.       EAST 35                 (35 is the bathroom)
  730.       NORTHEAST 36            (36 is the closet)
  731.       SPECIAL 50              <-- Special goes to room 50 (cavern)
  732.       KEY 223                 <-- Spec.activated by touching mirror
  733.       END_ROOM
  734.       ===============================================
  735.       
  736.       ===============================================
  737.       NOUN 223
  738.       Mirror                  
  739.       Strange                 (isn't there a better adjective?)
  740.       There is a wall-size mirror here.
  741.       LOCATION 34             (in the Master Bedroom)
  742.               rem: the player finds this mirror in the master bedroom,
  743.               rem: and gets to the Cavern by touching it. The player
  744.               rem: can only return if s/he has the magic amulet, and
  745.               rem: will need the soap from the bathroom to kill the
  746.               rem: demon on the bridge.
  747.       UNMOVABLE               (not very useful if the player can take it!)
  748.       PUSHABLE                <-- Here's how we'll activate the special
  749.       END_NOUN
  750.       ===============================================
  751.       
  752.                                       2-16      
  753.  
  754.       
  755.       Example of a badly-commented definition:
  756.       
  757.       ===============================================
  758.       ROOM 34                 
  759.       Master Bedroom
  760.       WEST 33                 (33 is the hallway)
  761.               (If the player decides to enter the bathroom to the
  762.               west, s/he will find the 32 gold pieces.)
  763.       EAST 35                 (35 is the bathroom)
  764.       NORTHEAST 36            (36 is the closet)
  765.       SPECIAL 50              <-- Special goes to room 50 (cavern)
  766.       KEY 223                 <-- Spec.activated by touching mirror
  767.               (The player gets to the mystic cavern by means of a
  768.               key special, activated by noun 233)
  769.       END_ROOM
  770.       ===============================================
  771.  
  772.          In the above example, the second full comment line begins with 
  773.       the keyword "WEST" and contains the number 32, so GAGS might 
  774.       decide that WEST should lead to room 32, changing the game! The 
  775.       last line before the END_ROOM could confuse GAGS and redefine the
  776.       key number (probably to zero).
  777.       
  778.       
  779.  
  780.  
  781.       
  782.                                       2-17      
  783.  
  784.       Verb synonyms:
  785.          To make up for a lack of extended vocabulary in GAGS, version 
  786.       1.06 includes a new feature allowing you to declare new verbs as 
  787.       synonyms of old verbs. The main restriction is that only one new 
  788.       verb may be matched to each old verb. The new verb will simply be 
  789.       translated by GAGS' parser, so error messages will refer to the 
  790.       verb GAGS knows, not the verb the player types. 
  791.          To redefine verbs, simply create a GAGS definition starting with 
  792.       VERB (alone on a line) and ending END_VERB (alone on a line). For 
  793.       example:
  794.  
  795.       VERB
  796.         KILL STAB
  797.         ATTACK STRANGLE
  798.         UP CLIMB
  799.       END_VERB
  800.  
  801.       In the above example, if the player types "Stab the dwarf with the 
  802.       knife," GAGS will translate the sentence to "Kill the dwarf with 
  803.       the knife" and attempt to do so. Likewise, if the player types 
  804.       "climb" the game will execute the sentence as if the player had 
  805.       typed "up" -- which means that "climb down" would be translated to 
  806.       "up down" which would, of course, confuse the game somewhat and 
  807.       generate an error message which might, in turn, confuse the player.  
  808.          Because the verb synonyms are not actually user-defined verbs, 
  809.       you should think carefully about the possible uses of words you 
  810.       add, to make sure the player won't be confused by the meaning of a 
  811.       word. You may only provide synonyms for verbs; you may not provide 
  812.       synonyms for nouns, adjectives, creatures, or phrases. 
  813.         Again, a verb may have only one synonym. The following entry 
  814.       would generate an error message in diagnostics mode and would have 
  815.       unpredictable results in standard game-playing mode.
  816.       
  817.            VERB
  818.              ATTACK ASSAULT
  819.              KILL STRANGLE
  820.              ATTACK KICK     <-- duplicate synonym for 'attack'
  821.            END_VERB
  822.       
  823.  
  824.       Warning Number One: It is NOT possible to define a synonym for a 
  825.       synonym. For example, the following entry would generate an error 
  826.       message: 
  827.       
  828.           VERB
  829.             ATTACK CHOKE
  830.             CHOKE STRANGLE    <-- "Verb not recognized - Line ignored"
  831.           END_VERB
  832.  
  833.       
  834.       Warning Number Two: You MAY re-define an existing verb, i.e.
  835.       
  836.          VERB
  837.            ATTACK PUSH
  838.          END_VERB
  839.       
  840.       
  841.       
  842.                                       2-18      
  843.  
  844.  
  845.       But this will disable the normal meaning for "PUSH." In this case, 
  846.       the same function is available through an alternate verb ("TOUCH") 
  847.       so the effect is not too drastic. It is possible to re-map verbs
  848.       this way, i.e.
  849.       
  850.         VERB
  851.           EAST TURN
  852.           TURN TWIST
  853.         END_VERB
  854.       
  855.       (In this case, the user can access the function normally provided 
  856.       by "turn" by typing "twist," but any use of the word "turn" will 
  857.       have the effect usually obtained by typing "east.")
  858.          As you can see, it's quite possible to confuse the heck out of 
  859.       people by re-mapping verbs extensively. It is also quite possible 
  860.       to create nonsense verbs that seem like specials. For example, you 
  861.       could map out (essentially disable) a verb and map a new verb to 
  862.       it, thus using the new verb to have the same effect as an old verb, 
  863.       as in the twist/turn example above. You might try mapping out 
  864.       directions, although you will have trouble finding enough uncommon 
  865.       verbs to map the disabled directions to, and then provide "magic" 
  866.       words that take the player in those "directions." 
  867.           Please note that verb synonyms add a very powerful feature but 
  868.       are still quite limited. Use them very carefully.
  869.       
  870.       =======================     
  871.  
  872.       Creature Time Threshholds:
  873.          Some gamewriters wanted more aggressive monsters -- and even 
  874.       monsters who would kill the player instantly. For them, I've added 
  875.       a new keyword to creatures: TIME_THRESH. A previous keyword, 
  876.       THRESHHOLD, determines how many times the player may unsuccessfully 
  877.       attack the creature before the creature rips the player to pieces. 
  878.       In contrast, TIME_THRESH determines how many turns the player can 
  879.       be in the same room with the creature before being killed. While a 
  880.       player could previously spend dozens of turns examining objects and 
  881.       reading scrolls without TIME_THRESH, s/he now must kill the 
  882.       creature before that time interval expires. A subtle warning ("The 
  883.       <creature> seems to be getting angrier") appears as the player approaches 
  884.       that threshhold. 
  885.          To avoid compatibility problems with earlier versions of GAGS, 
  886.       the default value of TIME_THRESH is -1, which disables it. The 
  887.       default value of THRESHHOLD is 3.
  888.       
  889.       ===============================================
  890.       CREATURE 315
  891.       Werewolf
  892.       Black
  893.       There is a menacing black werewolf here.
  894.       LOCATION 34
  895.       WEAPON 217                      <-- Noun 217 will kill it 
  896.       HOSTILE                         <-- ever met a friendly werewolf?
  897.       THRESHHOLD 3                    <-- (default)
  898.       TIME_THRESH 10                  <-- 10 turns to kill it
  899.       END_CREATURE
  900.       ===============================================
  901.       
  902.       
  903.       
  904.       
  905.                                       2-19      
  906.  
  907.  
  908.       GAME_WIN
  909.          
  910.          Oops. I didn't realize that there was no way to win a GAGS game 
  911.       before. At one point, I thought that acquiring all the points 
  912.       defined in the game would cause the player to win, but that wasn't 
  913.       the case. After careful consideration and several complaints, I 
  914.       have added a GAME_WIN option to rooms. If you define a room as 
  915.       GAME_WIN, then the player wins the game upon entering the room, 
  916.       and the game ends then.
  917.          The room description is displayed, so you should put your 
  918.       congratulatory description there.
  919.  
  920.  
  921.       ROOM 34                 
  922.        Master Bedroom
  923.        WEST 33                 (33 is the hallway)
  924.        EAST 35                 (35 is the bathroom)
  925.        NORTHEAST 36            (36 is the closet)
  926.        SPECIAL 50              <-- Special goes to room 50 (cavern)
  927.        KEY 223                 <-- Spec.activated by touching mirror
  928.        GAME_WIN
  929.       END_ROOM
  930.             
  931.                                      -30-
  932.       
  933.       
  934.       
  935.        _____________________________________________________________
  936.       |                                                             |
  937.       |  The Generic Adventure Game System, in all source code and  |
  938.       |  object code formats, and all related documents, are copy-  |
  939.       |  right 1985,1986 by Mark Welch. The Generic Adventure Game  |
  940.       |  System is distributed as Shareware, with restrictions as   |
  941.       |  specified in the documentation. Commericial use without    |
  942.       |  prior written permission is prohibited.                    |
  943.       |     GAGS is distributed as Shareware: if you like the       |
  944.       |  program, please become a registered user by sending $15    |
  945.       |  to the author:     Mark J. Welch                           |
  946.       |                     P.O. Box 2049                           |
  947.       |                     San Francisco, CA 94126-2409            |
  948.       |                     415-845-2430 (voice)                    |
  949.       |                     Fido 125/459 (private BBS node)         |
  950.       |_____________________________________________________________|
  951.       
  952.  
  953.